import request from '@/utils/request'

export default{

    // 1. 讲师列表(条件分页查询)
    // current 当前页 limit当前数   teacherQuery 条件查询
    getTeacherListPage(current,limit,teacherQuery){
        return request({
            url: `/eduservice/edu-teacher/pageTeacherCondition/${current}/${limit}`,
            method: 'post',
            // params
            // teacherQuery 条件对象 后端使用requestBody来获取数据 JSON数据
            // data 对象转为json传递给后端
            data: teacherQuery
          })
    },

    // 删除讲师
    deleteTeacherId(id){
        return request({
            url: `/eduservice/edu-teacher/${id}`,
            method: 'delete',
          })
    },

    // 添加讲师
    addTeacher(teacher){
        return request({
            url: `/eduservice/edu-teacher/addTeacher`,
            method: 'post',
            data: teacher
          })
    },

    // 根据id 查询讲师数据
    getTeacherInfo(id){
        return request({
            url: `/eduservice/edu-teacher/getTeacher/${id}`,
            method: 'get',
          })
    },
    // 修改数据
    updateTeacherInfo(teacher){
        return request({
            url: `/eduservice/edu-teacher/updateTeacher`,
            method: 'post',
            data: teacher
          })
    },

    // 得到所有的讲师没有分页
    getList(){
        return request({
            url: `/eduservice/edu-teacher/findAll`,
            method: 'get',
          })
    }


}

